import Service from './service'
import { useModel } from './model'
import { onMounted } from 'vue'
<% if(defineProps){ %>
	interface IProps {
		id: number
	}
	<% } %>
	<% if(defineEmits){ %>
	interface IEmit {
		(event: 'update', id: number): void
	}
	<% } %>
export const usePresenter = (<% if(defineProps){ %>props: IProps,<% } %> <% if(defineEmits){ %>emit: IEmit<% } %>) => {
  const model = useModel()
  const service = new Service(model)

  onMounted(() => {
    service.<%= serviceName %>(1)
  })

  return {
    model,
    service,
  }
}
